SG Window | Window Object |
FindWindows Method |
Properties Methods Events Constants Error Codes |
Returns Windows collection of descendent windows with matching class name and text.
object.FindWindows(className As String, text As String) As Windows
Part | Description |
object | The object is expression that evaluates to Window object |
className | Required. String to search inside the window class name. |
text | Required. String to search inside the window text. |
Enumerates all descendent windows and matches specified class name string and text
string against window's class and text. If specified strings are substrings of the
window's class and text, FindWindows creates new Window
object attached to the matched window and adds it to the result collection.
Empty string matches always.
Following example shows how to find all windows that contain string "Thunder" in their class name:
Dim desktop As New SGWindow.Window Dim wnd As SGWindow.Window Dim coll As SGWindow.Windows desktop.AttachDesktop Set coll = desktop.FindWindows("Thunder", "") For Each wnd in coll MsgBox wnd.Class & vbCrLf & wnd.Text Next